#ifndef TIMER_H
#define TIMER_H

#include <Boost/date_time/posix_time/posix_time.hpp>

class Timer;

using namespace boost::posix_time;
using namespace boost::gregorian;

class TimerCallable
{
public:
	virtual void CallAction(Timer* callerPtr) = 0;
	virtual ~TimerCallable() {};
};

class Timer
{
public:
	Timer(int hour, int minute, int secondes);
	Timer(const time_duration& time);
	virtual ~Timer();

	void AddListener(TimerCallable* caller);
	void Tick(float dTime);
	void Reset();

	time_duration GetResTimeDur();
	tstring GetResTime();

private:
	ptime m_EndTime;
	time_duration m_TimeDur;
	vector<TimerCallable*> m_Callers;

	Timer(const Timer &t);
	Timer& operator= (const Timer &t);	
};

#endif